
import React, { Component } from 'react';
import { Switch, withRouter, Route,Redirect } from 'react-router-dom'
import Approval from './views/approval'

import Home from "./views/Home";
import TopNav from "./components/TopNav";
import Apply from "./views/apply";
import Management from "./views/Management";
import BasicSetting from "./views/basicSetting";
import Supplier from "./views/basicSetting/Supplier"
import Warehouse from "./views/basicSetting/Warehouse"
import Thing from "./views/basicSetting/thing"
import Check from './components/Check'
import Login from './views/Login'
import Instore from "./components/PutInStorage/Instore"


       


@withRouter
class App extends Component {
  render() {
    return (

      <div>


      <>
        <TopNav />
        <Switch> 
          <Redirect exact from='/' to="/login" />  
          <Route path="/login" component={Login} />
          <Route path="/home" component={Home} />
          <Route path="/apply" component={Apply} />    
          <Route path="/approval" component={Approval} />
          <Route path="/management" component={Management} />
          {/* <Redirect exact from="/management" to="/management/check/survey"/>
          <Route path="/management/check/survey" component={Check}/> */}
          <Route path="/basicSetting" component={BasicSetting}  render={()=><Redirect to="/basicSetting/thing" />}/>
          <Route path="/basicSetting/thing" component={Thing} />
          <Route path="/basicSetting/warehouse" component={Warehouse} />
          <Route path="/basicSetting/supplier" component={Supplier} />
          <Route path="/management/instore" component={Instore} />
       </Switch>         
      </>
      </div>
    );
  }
}

export default App;
